package com.lx.service;

import com.lx.bean.Comment;
import com.lx.bean.CommentReply;
import com.lx.dao.CommentMapper;
import com.lx.dao.CommentReplyMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentService {
    @Autowired
    CommentMapper mapper;
    @Autowired
    CommentReplyMapper replyMapper;

    public List<Comment> selectBywherebyCommentandreply(Integer commid) {
        return mapper.selectByExampleWithBLOBswherebyComment(commid);

    }

    public Integer addcomment(Comment comment) {

        return mapper.insertSelective(comment);

    }

    public Integer addCommentReply(CommentReply reply) {
        return  replyMapper.insertSelective(reply);

    }
}
